﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ErhuBlog.IService;
using ErhuBlog.Service;
using ErhuBlog.Model;

namespace ErhuBlog.WebUI.Controllers
{
    public class HomeController : Controller
    {
        IsysUserInfoServices userInfoServices = new sysUserInfoServices();
        public ActionResult Index()
        {
            try
            {
                for (int i = 0; i < 10; i++)
                {
                    userInfoServices.Add(new sysUserInfo()
                    {
                        uLoginName="admin"+i,
                        uLoginPWD = "123456",
                        uRealName = "超级管理员" + i,
                        uCreateTime = DateTime.Now,
                        uUpdateTime = DateTime.Now,
                        uRemark = "测试添加功能"
                    });

                }
                userInfoServices.SaveChanges();
                return Content("添加数据成功");

            }
            catch (Exception ex)
            {

                return Content("错误提示：" + ex.Message);
            }
            return View();
        }

        public ActionResult About()
        {
            ViewBag.Message = "Your application description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }
    }
}